<?php 

include '../function.php';
// 1.链接数据库，选择库
$mysqli = @new mysqli("127.0.0.1", "root", "", "school");

if($mysqli->connect_errno){
	exit("错误代码：".$mysqli->connect_errno."错误信息：".$mysqli->connect_error);
}

// 2、发送编码
$mysqli->query("set names utf8");


// 3.执行语句
$res = $mysqli->query('select name,score from stu order by score desc limit 3');
// 

// $res = $mysqli->query('delete from stu where id>11');

// var_dump($res);
// 
// 
// 循环取出结果集
// $tempArr = [];
// while ($row = $res->fetch_assoc()) {
// 	$tempArr[]=$row;
// }

// var_dump($tempArr);
// 
// $sql = "insert into stu (name,age) values()";

// $row->name;
// 
// 释放资源，
$res->free();
// 关闭链接
$mysqli->close();





















 ?>